package net.csdn.business.notify.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.csdn.business.notify.common.model.entity.NotifyAnnounceUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 通知中心-用户公告Mapper接口
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
public interface NotifyAnnounceUserMapper extends BaseMapper<NotifyAnnounceUser>
{

    @Delete("<script> delete from notify_announce_user where announce_id= #{announceId} </script>")
    public Integer deleteNotifyAnnounceUser(String announceId);



    @Insert("<script> insert into notify_announce_user (object_id,announce_id," +
            " receiver_id,read_state" +
            " ) VALUES " +
            " <foreach collection ='list' item='entity' index= 'index' separator =','> " +
            " ( " +
            "  #{entity.objectId},#{entity.announceId}, " +
            " #{entity.receiverId},#{entity.readState} " +
            " ) " +
            " </foreach> " +
            "</script>")
    public Integer insertBatch(@Param("list") List<NotifyAnnounceUser> list);

}
